/*
 *  InputEngine.h
 *  GLRender
 *
 *  Created by Patrick zulian on 5/4/10.
 *  Copyright 2010 University  of Lugano. All rights reserved.
 *
 */

#ifndef INPUT_ENGINE
#define INPUT_ENGINE

#include "World.h"
#include "Player.h"
#include <map>

class InputEngine {
private:
	World * world;
	std::set< int > keys;
	bool leftMousePressed;
	//std::map<int, IFunction *> keyToCommandMap;
public:
	InputEngine() { };
	InputEngine(World * world);
	
	
	void setWorld(World * world) { this->world = world; }
	bool keyPressEvent( QKeyEvent * e );
	bool keyReleaseEvent( QKeyEvent * e );
	bool mousePressed (QMouseEvent *e);
	void processInputs();
	void processPressedKeys();
	
	static InputEngine * INSTANCE;
	static InputEngine * getInstance();
};

#endif
